package cc.lj.internal.merchant.domain.contract.event;

import cc.lj.internal.core.model.BaseDomainEvent;
import cn.hutool.core.date.DateUtil;
import lj.internal.dict.enums.EventSourceType;
import lombok.Data;

import java.util.UUID;


@Data
public class ContractDomainEvent extends BaseDomainEvent<MerchantContractToMqEvent> {

    public static ContractDomainEvent createDomainEvent(MerchantContractToMqEvent mqEvent, EventSourceType sourceType)
    {
        ContractDomainEvent event = new ContractDomainEvent();
        event.setId(UUID.randomUUID().toString().replace("-",""));
        event.setSource(sourceType);
        event.setTimestamp(DateUtil.date());
        event.setData(mqEvent);
        return event;
    }
}
